package gs.android.bingomathfree;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.LinearLayout;

public class DialogAds extends Dialog {
	private LinearLayout app_1, app_2, app_3;
	private Context context;
	
	private View.OnClickListener listener = new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			String id = (String) v.getTag();
			context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + id)));
		}
	};
	
	public DialogAds(Context context) {
		super(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
		setContentView(R.layout.ads);
		
		this.context = context;
		
		app_1 = (LinearLayout) findViewById(R.id.app_1);
		app_1.setTag("com.p2l.letterblocks");
		app_1.setOnClickListener(listener);
		
		app_2 = (LinearLayout) findViewById(R.id.app_2);
		app_2.setTag("com.gs.mathballoontrouble");
		app_2.setOnClickListener(listener);
		
		app_3 = (LinearLayout) findViewById(R.id.app_3);
		app_3.setTag("gs.android.videopokercollection");
		app_3.setOnClickListener(listener);
	}
}